package com.ruoyi.web.controller.app;

import com.ruoyi.common.core.domain.Domain;
import com.ruoyi.common.core.page.ResponseResult;
import com.ruoyi.system.vo.BaseVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@Api(tags = "无鉴权:轮播图")
@RestController
@RequestMapping("public/banner")
public class BannerController extends AppController {


    @ApiOperation(value = "轮播列表")
    @RequestMapping("list")
    public ResponseResult<List<Banner>> list() {
        HomeVo homeVo = new HomeVo();
        homeVo.setNotice("尊敬的代理们,用户下单后,请及时发货");
        List<Banner> list =new ArrayList<>();

        homeVo.setList(list);

        return this.setSuccessResult(homeVo);

    }

    @Data
    class HomeVo extends BaseVo {
        private List<Banner> list;
        private String notice;
    }

    @Data
    @Accessors(chain = true)
    @EqualsAndHashCode(callSuper = false)
    public class Banner extends Domain {

        @ApiModelProperty(value = "名称")

        private String title;

        @ApiModelProperty(value = "图片")

        private String img;

        @ApiModelProperty(value = "排序")

        private Integer sorter;

        @ApiModelProperty(value = "1 已失效  0  正常")
        private Integer invalid;

    }


}
